;;; init-xml.el --- Configuration file for edit xml file -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:

(defun nxml-where ()
  "Display the hierarchy of XML elements the point is on as a
path. from http://www.emacswiki.org/emacs/NxmlMode"
  (interactive)
  (let ((path nil))
    (save-excursion
      (save-restriction
        (widen)
        (while
            (and (< (point-min) (point)) ;; Doesn't error if point is at
                 ;; beginning of buffer
                 (condition-case nil
                     (progn
                       (nxml-backward-up-element) ; always returns nil
                       t)
                   (error nil)))
          (setq path (cons (xmltok-start-tag-local-name) path)))
        (if (called-interactively-p t)
            (message "/%s" (mapconcat 'identity path "/"))
          (format "/%s" (mapconcat 'identity path "/")))))))

(add-hook 'nxml-mode-hook #'lsp)
(with-eval-after-load 'nxml-mode
  (require 'lsp-xml)

  (add-to-list 'rng-schema-locating-files
               (expand-file-name "nxml-schemas/schemas.xml" ctrlwei-etc-dir))
  (define-key nxml-mode-map (kbd "C-c C-p") 'rng-previous-error))

(provide 'init-xml)
;;; init-xml.el ends here
